# 建造者模式

from abc import ABCMeta, abstractmethod

class Vehicle(metaclass=ABCMeta):
    @abstractmethod
    def build_wheels(self):
        pass
    @abstractmethod
    def build_engine(self):
        pass
    @abstractmethod
    def build_body(self):
        pass

class CarBuilder:
    def __init__(self):
        self.car = Vehicle()
    def build_wheels(self):
        self.car.wheels = "4"
    def build_engine(self):
        self.car.engine = "2000"
    def build_body(self):
        self.car.body = "sedan"

if __name__ == "__main__": 
    builder = CarBuilder()
    builder.build_wheels()
    builder.build_engine()
    builder.build_body()
    print(builder.car.wheels, builder.car.engine, builder.car.body)